#ifndef __ANIMATION_UNIT_H__
#define __ANIMATION_UNIT_H__

#include "cocos2d.h"
#include "cocostudio/CocoStudio.h"
#include "ui/CocosGUI.h"

#include "AnimationCell.h"

using namespace cocos2d;
using namespace cocos2d::ui;
using namespace cocostudio::timeline;
using namespace experimental;
using namespace std;

class AnimationUnit
{
public:
	string getName();
	void setName(const char* name);

	ActionTimeline* getAction();
	void setAction(const char* actionFileName);
	void setAction(ActionTimeline* action);

	string getMainCellName();
	void setMainCellName(const char* mainCellName);

	list<AnimationCell> getAnimationCells();
	void addAnimationCell(AnimationCell cell);

	std::function<void()> getCallBackFunc();
	void setCallBackFunc(std::function<void()> callBackFunc);

	list<list<string>> getSounds();
	void setSounds(list<list<string>> sounds);

	float getTimeout();
	void setTimeout(float timeout);

	string getNextUnitName();
	void setNextUnitName(string nextUnitName);

	float getGivenTimeTotal();
	void setGivenTimeTotal(float givenTimeTotal);

	int getEndType();
	void setEndType(int endType);

private:
	//id
	string m_name;

	//action
	ActionTimeline * m_action;
	string m_mainCellName;
	list<AnimationCell> m_animationCells;
	std::function<void()> m_callBackFunc;

	//sound list
	list<list<string>> m_sounds;

	float m_timeout;

	//next
	string m_nextUnitName;
	float m_givenTimeTotal;
	int m_endType;//(end- [1]animation end| [2]sound end |[3] all end|[4] given time end)

};
#endif